<template>
  <div class="container">
    <el-row style="background-color: #fff;margin-bottom: 12px;">
      <toll-business-form @dwVisible="openDw"
                          @chargeVisible="openCharge"
                          @tableLoad="setTableLoad"
                          @tableData="getTableData"
                          :dwName="dwName"
                          :pageNum="pageNum"
                          :pageSize="pageSize"
                          :charge="charge"></toll-business-form>
    </el-row>
    <el-row style="background-color: #fff">
      <toll-business-table :tableLoad="tableLoad" :tableData="tableData" @pageNum="setPageNum" @pageSize="setPageSize"></toll-business-table>
    </el-row>
    <person-child-dialog-dw
      @dwName="setDwName"
      :dialogDwVisible.sync="dwVisible"
      :dwLoading.sync="dwLoading"
      :dwType="dwType"></person-child-dialog-dw>
    <person-select-dialog :dialogSelectPerVisible.sync="chargeVisible" @selectPer="setCharge"></person-select-dialog>
  </div>
</template>
<script>
  import TollBusinessForm from './tollBusinessChild/tollBusinessForm'
  import PersonChildDialogDw from '../organizationManagement/personChild/personChildDialogDw'
  import PersonSelectDialog from '../organizationManagement/organizationChild/personSelectDialog'
  import TollBusinessTable from './tollBusinessChild/tollBusinessTable'
  export default {
    components: { TollBusinessTable, PersonSelectDialog, PersonChildDialogDw, TollBusinessForm },
    data() {
      return {
        dwVisible: false,
        chargeVisible: false,
        dwLoading: false,
        tableLoad: false,
        tableData: [],
        dwType: 0,
        dwName: '',
        charge: '',
        pageNum: 1,
        pageSize: 10
      }
    },
    methods: {
      openDw(val) {
        this.dwType = 0
        this.dwLoading = val
        this.dwVisible = val
      },
      setDwName(val) {
        this.dwName = val
      },
      openCharge(val) {
        this.chargeVisible = val
      },
      setCharge(val) {
        this.charge = val
      },
      setTableLoad(val) {
        this.tableLoad = val
      },
      setPageNum(val) {
        this.pageNum = val
      },
      setPageSize(val) {
        this.pageSize = val
      },
      getTableData(val) {
        this.tableData = val
      }
    }
  }
</script>
<style scoped>
  .container {
    padding: 42px;
    padding-top: 20px;
    background-color: rgb(240, 242, 245);
  }
</style>
